import { createApp } from 'vue'
import './style.css'
import App from './App.vue'
import {Button, Icon, Form, Field, Skeleton, Swipe, SwipeItem} from "vant"; // 引入组件
import router from "./router/index.js";
import 'lib-flexible' // 引入适配rem文件
import store from "./store";

const app = createApp(App)
app.use(router)
// 注册全局示状态实例
app.use(store)
// 注册全局组件
app.use(Button)
app.use(Icon)
app.use(Form)
app.use(Field)
app.use(Skeleton)
app.use(Swipe)
app.use(SwipeItem)
app.mount('#app')

// 全局过滤器
app.config.globalProperties.$filters = {
    prefix(url) {
        if (url && url.startsWith('http')){
            return url
        }else {
            url = `http://backend-api-01.newbee.ltd${url}`
            return url
        }
    }
}
